/**
 * 描述: 服务-小程序管理
 * 版权: Copyright (c) 2019
 * 公司: 深圳市网商天下科技开发有限公司
 * 作者: 许堉颖
 * 版本: 1.0.0
 * 创建时间: 2020/03/11 10:23
 */
import {Service, RequestParams} from 'vue-element-simple';

// ====================发布小程序
/**
 * 检查小程序是否有新版本
 * @param params
 * @returns {Promise.<*>}
 */
Service.applicationCheckWxAppUpdate = async function (params = {}) {
  const request = new RequestParams();
  request.put('projectName', params['projectName']);
  return await this.getService(`/admin/wxMiniPublish/checkUpdate`, request);
};

/**
 * 获取小程序预览码
 * @param params
 * @returns {Promise.<*>}
 */
Service.applicationLoadPreviewCode = async function (params = {}) {
  const request = new RequestParams();
  request.put('projectName', params['projectName']);
  return await this.getService(`/admin/wxMiniPublish/previewByMini`, request);
};

/**
 * 上传小程序到公众平台
 * @param params
 * @returns {Promise.<*>}
 */
Service.applicationPublishVersion = async function (params = {}) {
  const request = new RequestParams();
  request.put('projectName', params['projectName']);
  return await this.getService(`/admin/wxMiniPublish/publishByMini`, request);
};
// ====================发布小程序
